<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>Data::Util - A selection of utilities for data and data types - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of Data-Util - MetaCPAN" href="https://metacpan.org/dist/Data-Util/releases.rss" />
        <link rel="canonical" href="./Data::Util.html" />
        <meta name="description" content="A selection of utilities for data and data types" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/Data::Util" />
<meta name="twitter:title"       content="Data::Util" />
<meta name="twitter:description" content="A selection of utilities for data and data types" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./Data::Util.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of Data-Util was released.">
      <span class="relatize">16 Mar 2022 04:30:34 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/Data-Util">Data-Util</a>
  </li>
  <li>
    Module version: 0.67
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/Data-Util/source/lib/Data/Util.pm">Source</a>
    (<a href="https://metacpan.org/dist/Data-Util/source/lib/Data/Util.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/Data-Util/source/lib/Data">Browse</a>
    (<a href="https://metacpan.org/dist/Data-Util/source/lib/Data?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/Data-Util/changes">Changes</a>
    </li>
    <li>
      <a rel="noopener nofollow" class="nopopup" href="https://github.com/gfx/Perl-Data-Util">Homepage</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/Data-Util/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/gfx/Perl-Data-Util">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://github.com/gfx/Perl-Data-Util/issues">Issues</a>
      (4)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=Data-Util+0.67" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Util.html?oncpan=1&amp;distmat=1&amp;version=0.67&amp;grade=2" style="color: #090">2302</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Util.html?oncpan=1&amp;distmat=1&amp;version=0.67&amp;grade=3" style="color: #900">0</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/D/Data-Util.html?oncpan=1&amp;distmat=1&amp;version=0.67&amp;grade=4">3</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/SYOHEX/Data-Util-0.67">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on Data-Util who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 1
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/Data-Util-0.67/index.html">% Coverage </a>
    </li>
    <li>
      License: perl_5
    </li>
    <li>
      Perl: v5.10.0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/Data-Util/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/S/SY/SYOHEX/Data-Util-0.67.tar.gz">
      Download (<span itemprop="fileSize">60.82KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FSYOHEX%2FData-Util-0.67%2Flib%2FData%2FUtil.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Data-Util/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/Data-Util/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:Data-Util">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="Data-Util">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Data/Util.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="SYOHEX/Data-Util-0.67"
>0.67
  (SYOHEX on 2022-03-16)</option>
<option
  
  value="SYOHEX/Data-Util-0.66"
>0.66
  (SYOHEX on 2017-04-05)</option>
<option
  
  value="SYOHEX/Data-Util-0.65"
>0.65
  (SYOHEX on 2016-08-01)</option>
<option
  
  value="SYOHEX/Data-Util-0.64"
>0.64
  (SYOHEX on 2016-07-23)</option>
<option
  
  value="GFUJI/Data-Util-0.63"
>0.63
  (GFUJI on 2014-03-05)</option>
<option
  
  value="GFUJI/Data-Util-0.62"
>0.62
  (GFUJI on 2013-04-03)</option>
<option
  
  value="GFUJI/Data-Util-0.61"
>0.61
  (GFUJI on 2013-01-28)</option>
<option
  
  value="GFUJI/Data-Util-0.60"
>0.60
  (GFUJI on 2012-10-20)</option>
<option
  
  value="GFUJI/Data-Util-0.59"
>0.59
  (GFUJI on 2011-10-20)</option>
<option
  
  value="GFUJI/Data-Util-0.58"
>0.58
  (GFUJI on 2010-09-13)</option>
<option
  
  value="GFUJI/Data-Util-0.57"
>0.57
  (GFUJI on 2010-08-01)</option>
<option
  
  value="GFUJI/Data-Util-0.56"
>0.56
  (GFUJI on 2010-01-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="GFUJI/Data-Util-0.55"
>0.55
  (GFUJI on 2009-12-24)</option>
<option
  
  value="MAUKE/Data-Util-0.02"
>0.02
  (MAUKE on 2009-12-14)</option>
<option
  
  value="GFUJI/Data-Util-0.54"
>0.54
  (GFUJI on 2009-10-21)</option>
<option
  
  value="GFUJI/Data-Util-0.53"
>0.53
  (GFUJI on 2009-10-19)</option>
<option
  
  value="GFUJI/Data-Util-0.52"
>0.52
  (GFUJI on 2009-07-13)</option>
<option
  
  value="GFUJI/Data-Util-0.51"
>0.51
  (GFUJI on 2009-07-09)</option>
<option
  
  value="GFUJI/Data-Util-0.50"
>0.50
  (GFUJI on 2009-01-20)</option>
<option
  
  value="GFUJI/Data-Util-0.44"
>0.44
  (GFUJI on 2008-12-21)</option>
<option
  
  value="GFUJI/Data-Util-0.43"
>0.43
  (GFUJI on 2008-12-14)</option>
<option
  
  value="GFUJI/Data-Util-0.42"
>0.42
  (GFUJI on 2008-12-10)</option>
<option
  
  value="GFUJI/Data-Util-0.41"
>0.41
  (GFUJI on 2008-12-08)</option>
<option
  
  value="GFUJI/Data-Util-0.40"
>0.40
  (GFUJI on 2008-12-07)</option>
<option
  
  value="GFUJI/Data-Util-0.32"
>0.32
  (GFUJI on 2008-12-04)</option>
<option
  
  value="GFUJI/Data-Util-0.31"
>0.31
  (GFUJI on 2008-12-03)</option>
<option
  
  value="GFUJI/Data-Util-0.30"
>0.30
  (GFUJI on 2008-12-01)</option>
<option
  
  value="GFUJI/Data-Util-0.29_02"
>0.29_02 DEV
  (GFUJI on 2008-11-30)</option>
<option
  
  value="GFUJI/Data-Util-0.29_01"
>0.29_01 DEV
  (GFUJI on 2008-11-24)</option>
<option
  
  value="GFUJI/Data-Util-0.21"
>0.21
  (GFUJI on 2008-11-17)</option>
<option
  
  value="GFUJI/Data-Util-0.20"
>0.20
  (GFUJI on 2008-11-16)</option>
<option
  
  value="GFUJI/Data-Util-0.19_01"
>0.19_01 DEV
  (GFUJI on 2008-11-13)</option>
<option
  
  value="GFUJI/Data-Util-0.11"
>0.11
  (GFUJI on 2008-11-04)</option>
<option
  
  value="GFUJI/Data-Util-0.10"
>0.10
  (GFUJI on 2008-11-01)</option>
<option
  
  value="GFUJI/Data-Util-0.05"
>0.05
  (GFUJI on 2008-10-29)</option>
<option
  
  value="GFUJI/Data-Util-0.041"
>0.041
  (GFUJI on 2008-10-27)</option>
<option
  
  value="GFUJI/Data-Util-0.04"
>0.04
  (GFUJI on 2008-10-26)</option>
<option
  
  value="GFUJI/Data-Util-0.03"
>0.03
  (GFUJI on 2008-10-24)</option>
<option
  
  value="GFUJI/Data-Util-0.02"
>0.02
  (GFUJI on 2008-10-24)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/SYOHEX/Data-Util-0.67/diff/' + encodeURIComponent(this.value) + '/lib/Data/Util.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="SYOHEX/Data-Util-0.67"
>0.67
  (SYOHEX on 2022-03-16)</option>
<option
  
  value="SYOHEX/Data-Util-0.66"
>0.66
  (SYOHEX on 2017-04-05)</option>
<option
  
  value="SYOHEX/Data-Util-0.65"
>0.65
  (SYOHEX on 2016-08-01)</option>
<option
  
  value="SYOHEX/Data-Util-0.64"
>0.64
  (SYOHEX on 2016-07-23)</option>
<option
  
  value="GFUJI/Data-Util-0.63"
>0.63
  (GFUJI on 2014-03-05)</option>
<option
  
  value="GFUJI/Data-Util-0.62"
>0.62
  (GFUJI on 2013-04-03)</option>
<option
  
  value="GFUJI/Data-Util-0.61"
>0.61
  (GFUJI on 2013-01-28)</option>
<option
  
  value="GFUJI/Data-Util-0.60"
>0.60
  (GFUJI on 2012-10-20)</option>
<option
  
  value="GFUJI/Data-Util-0.59"
>0.59
  (GFUJI on 2011-10-20)</option>
<option
  
  value="GFUJI/Data-Util-0.58"
>0.58
  (GFUJI on 2010-09-13)</option>
<option
  
  value="GFUJI/Data-Util-0.57"
>0.57
  (GFUJI on 2010-08-01)</option>
<option
  
  value="GFUJI/Data-Util-0.56"
>0.56
  (GFUJI on 2010-01-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="GFUJI/Data-Util-0.55"
>0.55
  (GFUJI on 2009-12-24)</option>
<option
  
  value="MAUKE/Data-Util-0.02"
>0.02
  (MAUKE on 2009-12-14)</option>
<option
  
  value="GFUJI/Data-Util-0.54"
>0.54
  (GFUJI on 2009-10-21)</option>
<option
  
  value="GFUJI/Data-Util-0.53"
>0.53
  (GFUJI on 2009-10-19)</option>
<option
  
  value="GFUJI/Data-Util-0.52"
>0.52
  (GFUJI on 2009-07-13)</option>
<option
  
  value="GFUJI/Data-Util-0.51"
>0.51
  (GFUJI on 2009-07-09)</option>
<option
  
  value="GFUJI/Data-Util-0.50"
>0.50
  (GFUJI on 2009-01-20)</option>
<option
  
  value="GFUJI/Data-Util-0.44"
>0.44
  (GFUJI on 2008-12-21)</option>
<option
  
  value="GFUJI/Data-Util-0.43"
>0.43
  (GFUJI on 2008-12-14)</option>
<option
  
  value="GFUJI/Data-Util-0.42"
>0.42
  (GFUJI on 2008-12-10)</option>
<option
  
  value="GFUJI/Data-Util-0.41"
>0.41
  (GFUJI on 2008-12-08)</option>
<option
  
  value="GFUJI/Data-Util-0.40"
>0.40
  (GFUJI on 2008-12-07)</option>
<option
  
  value="GFUJI/Data-Util-0.32"
>0.32
  (GFUJI on 2008-12-04)</option>
<option
  
  value="GFUJI/Data-Util-0.31"
>0.31
  (GFUJI on 2008-12-03)</option>
<option
  
  value="GFUJI/Data-Util-0.30"
>0.30
  (GFUJI on 2008-12-01)</option>
<option
  
  value="GFUJI/Data-Util-0.29_02"
>0.29_02 DEV
  (GFUJI on 2008-11-30)</option>
<option
  
  value="GFUJI/Data-Util-0.29_01"
>0.29_01 DEV
  (GFUJI on 2008-11-24)</option>
<option
  
  value="GFUJI/Data-Util-0.21"
>0.21
  (GFUJI on 2008-11-17)</option>
<option
  
  value="GFUJI/Data-Util-0.20"
>0.20
  (GFUJI on 2008-11-16)</option>
<option
  
  value="GFUJI/Data-Util-0.19_01"
>0.19_01 DEV
  (GFUJI on 2008-11-13)</option>
<option
  
  value="GFUJI/Data-Util-0.11"
>0.11
  (GFUJI on 2008-11-04)</option>
<option
  
  value="GFUJI/Data-Util-0.10"
>0.10
  (GFUJI on 2008-11-01)</option>
<option
  
  value="GFUJI/Data-Util-0.05"
>0.05
  (GFUJI on 2008-10-29)</option>
<option
  
  value="GFUJI/Data-Util-0.041"
>0.041
  (GFUJI on 2008-10-27)</option>
<option
  
  value="GFUJI/Data-Util-0.04"
>0.04
  (GFUJI on 2008-10-26)</option>
<option
  
  value="GFUJI/Data-Util-0.03"
>0.03
  (GFUJI on 2008-10-24)</option>
<option
  
  value="GFUJI/Data-Util-0.02"
>0.02
  (GFUJI on 2008-10-24)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/XSLoader" title="XSLoader" class="ellipsis">XSLoader</a></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/Data::Util/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=Data%3A%3AUtil">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=Data-Util">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/SYOHEX/Data-Util-0.67/view/lib/Data/Util.pm">This version</a>
    </li>
    <li>
      <a href="./Data::Util.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/ARISTOTLE"><img src="https://www.gravatar.com/avatar/81da52fa1b6754867e9056c58afab74d?d=identicon&amp;s=20" title="ARISTOTLE" alt="ARISTOTLE"></a>
<a class="display-all" href="https://metacpan.org/author/RSIMOES"><img src="https://www.gravatar.com/avatar/08c9b8c4fa5870b86f2054212261e02a?d=identicon&amp;s=20" title="RSIMOES" alt="RSIMOES"></a>
<a class="display-all" href="https://metacpan.org/author/MIXAS"><img src="https://www.gravatar.com/avatar/57024569984e31ce52a855c7305be66e?d=identicon&amp;s=20" title="MIXAS" alt="MIXAS"></a>
<a class="display-all" href="https://metacpan.org/author/AYOUNG"><img src="https://www.gravatar.com/avatar/8d1e4946c288fbe87d1e0394f3e41b24?d=identicon&amp;s=20" title="AYOUNG" alt="AYOUNG"></a>
<a class="display-all" href="https://metacpan.org/author/EGOR"><img src="https://www.gravatar.com/avatar/d1b2873e176897abb1f26be3a92e771d?d=identicon&amp;s=20" title="EGOR" alt="EGOR"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/Data-Util/plussers">5 PAUSE users</a>
</div>
<div>
    6 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 7 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
    >
      Goro Fuji(gfx) &lt;gfuji(at)cpan.org&gt;.
    </li>
    <li class="contributor"
      data-contrib-email="fuji.goro@dena.jp"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Fuji Goro
    </li>
    <li class="contributor"
      data-cpan-author="GFUJI"
      data-contrib-email="gfuji@cpan.org"
    >
      <a href="https://metacpan.org/author/GFUJI" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/9278c3a06b8d8752fb913dea93f959c1?d=identicon&amp;s=20" />
      Fuji, Goro (gfx)
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="GFUJI"
      data-contrib-email="g.psy.va@gmail.com"
    >
      <a href="https://metacpan.org/author/GFUJI" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/9278c3a06b8d8752fb913dea93f959c1?d=identicon&amp;s=20" />
      Fuji, Goro
      </a>
    </li>
    <li class="contributor"
      data-contrib-email="monsieurp@gentoo.org"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Patrice Clement
    </li>
    <li class="contributor"
      data-contrib-email="syohex@gmail.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Shohei YOSHIDA
    </li>
    <li class="contributor"
      data-contrib-email="tokuhirom@gmail.com"
    >
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/d41d8cd98f00b204e9800998ecf8427e?d=identicon&amp;s=20" />
      Tokuhiro Matsuno
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/SYOHEX" class="author-name">Shohei Yoshida</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/Data/Util.pm&#39;" class="">
<option
  selected
  value="SYOHEX/Data-Util-0.67"
>0.67
  (SYOHEX on 2022-03-16)</option>
<option
  
  value="SYOHEX/Data-Util-0.66"
>0.66
  (SYOHEX on 2017-04-05)</option>
<option
  
  value="SYOHEX/Data-Util-0.65"
>0.65
  (SYOHEX on 2016-08-01)</option>
<option
  
  value="SYOHEX/Data-Util-0.64"
>0.64
  (SYOHEX on 2016-07-23)</option>
<option
  
  value="GFUJI/Data-Util-0.63"
>0.63
  (GFUJI on 2014-03-05)</option>
<option
  
  value="GFUJI/Data-Util-0.62"
>0.62
  (GFUJI on 2013-04-03)</option>
<option
  
  value="GFUJI/Data-Util-0.61"
>0.61
  (GFUJI on 2013-01-28)</option>
<option
  
  value="GFUJI/Data-Util-0.60"
>0.60
  (GFUJI on 2012-10-20)</option>
<option
  
  value="GFUJI/Data-Util-0.59"
>0.59
  (GFUJI on 2011-10-20)</option>
<option
  
  value="GFUJI/Data-Util-0.58"
>0.58
  (GFUJI on 2010-09-13)</option>
<option
  
  value="GFUJI/Data-Util-0.57"
>0.57
  (GFUJI on 2010-08-01)</option>
<option
  
  value="GFUJI/Data-Util-0.56"
>0.56
  (GFUJI on 2010-01-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="GFUJI/Data-Util-0.55"
>0.55
  (GFUJI on 2009-12-24)</option>
<option
  
  value="MAUKE/Data-Util-0.02"
>0.02
  (MAUKE on 2009-12-14)</option>
<option
  
  value="GFUJI/Data-Util-0.54"
>0.54
  (GFUJI on 2009-10-21)</option>
<option
  
  value="GFUJI/Data-Util-0.53"
>0.53
  (GFUJI on 2009-10-19)</option>
<option
  
  value="GFUJI/Data-Util-0.52"
>0.52
  (GFUJI on 2009-07-13)</option>
<option
  
  value="GFUJI/Data-Util-0.51"
>0.51
  (GFUJI on 2009-07-09)</option>
<option
  
  value="GFUJI/Data-Util-0.50"
>0.50
  (GFUJI on 2009-01-20)</option>
<option
  
  value="GFUJI/Data-Util-0.44"
>0.44
  (GFUJI on 2008-12-21)</option>
<option
  
  value="GFUJI/Data-Util-0.43"
>0.43
  (GFUJI on 2008-12-14)</option>
<option
  
  value="GFUJI/Data-Util-0.42"
>0.42
  (GFUJI on 2008-12-10)</option>
<option
  
  value="GFUJI/Data-Util-0.41"
>0.41
  (GFUJI on 2008-12-08)</option>
<option
  
  value="GFUJI/Data-Util-0.40"
>0.40
  (GFUJI on 2008-12-07)</option>
<option
  
  value="GFUJI/Data-Util-0.32"
>0.32
  (GFUJI on 2008-12-04)</option>
<option
  
  value="GFUJI/Data-Util-0.31"
>0.31
  (GFUJI on 2008-12-03)</option>
<option
  
  value="GFUJI/Data-Util-0.30"
>0.30
  (GFUJI on 2008-12-01)</option>
<option
  
  value="GFUJI/Data-Util-0.29_02"
>0.29_02 DEV
  (GFUJI on 2008-11-30)</option>
<option
  
  value="GFUJI/Data-Util-0.29_01"
>0.29_01 DEV
  (GFUJI on 2008-11-24)</option>
<option
  
  value="GFUJI/Data-Util-0.21"
>0.21
  (GFUJI on 2008-11-17)</option>
<option
  
  value="GFUJI/Data-Util-0.20"
>0.20
  (GFUJI on 2008-11-16)</option>
<option
  
  value="GFUJI/Data-Util-0.19_01"
>0.19_01 DEV
  (GFUJI on 2008-11-13)</option>
<option
  
  value="GFUJI/Data-Util-0.11"
>0.11
  (GFUJI on 2008-11-04)</option>
<option
  
  value="GFUJI/Data-Util-0.10"
>0.10
  (GFUJI on 2008-11-01)</option>
<option
  
  value="GFUJI/Data-Util-0.05"
>0.05
  (GFUJI on 2008-10-29)</option>
<option
  
  value="GFUJI/Data-Util-0.041"
>0.041
  (GFUJI on 2008-10-27)</option>
<option
  
  value="GFUJI/Data-Util-0.04"
>0.04
  (GFUJI on 2008-10-26)</option>
<option
  
  value="GFUJI/Data-Util-0.03"
>0.03
  (GFUJI on 2008-10-24)</option>
<option
  
  value="GFUJI/Data-Util-0.02"
>0.02
  (GFUJI on 2008-10-24)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/Data-Util">Data-Util-0.67</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage three &#10;
          • 29 direct dependents &#10;          • 133 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#e4e2e2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="Data-Util-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="Data-Util-0.67">
    <input type="hidden" name="author" value="SYOHEX">
    <input type="hidden" name="distribution" value="Data-Util">
    <button type="submit" class="favorite highlight"><span>11</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./Data::Util.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>11</span> ++</a>
</div>
   / <span>Data::Util</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./Data::Util.html#NAME">NAME</a></li>
  <li><a href="./Data::Util.html#VERSION">VERSION</a></li>
  <li><a href="./Data::Util.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./Data::Util.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./Data::Util.html#INTERFACE">INTERFACE</a>
    <ul>
      <li><a href="./Data::Util.html#Check-functions">Check functions</a></li>
      <li><a href="./Data::Util.html#Validating-functions">Validating functions</a></li>
      <li><a href="./Data::Util.html#Miscellaneous-utilities">Miscellaneous utilities</a></li>
    </ul>
  </li>
  <li><a href="./Data::Util.html#ENVIRONMENT-VARIABLES">ENVIRONMENT VARIABLES</a>
    <ul>
      <li><a href="./Data::Util.html#DATA_UTIL_PUREPERL">DATA_UTIL_PUREPERL</a></li>
    </ul>
  </li>
  <li><a href="./Data::Util.html#DEPENDENCIES">DEPENDENCIES</a></li>
  <li><a href="./Data::Util.html#BUGS-AND-LIMITATIONS">BUGS AND LIMITATIONS</a></li>
  <li><a href="./Data::Util.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./Data::Util.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./Data::Util.html#LICENSE-AND-COPYRIGHT">LICENSE AND COPYRIGHT</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>Data::Util - A selection of utilities for data and data types</p>

<h1 id="VERSION">VERSION</h1>

<p>This document describes Data::Util version 0.67</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>        use Data::Util qw(:validate);

        sub foo{
                # they will die if invalid values are supplied
                my $sref = scalar_ref(shift);
                my $aref = array_ref(shift);
                my $href = hash_ref(shift);
                my $cref = code_ref(shift);
                my $gref = glob_ref(shift);
                my $rx   = rx(shift); # regular expression
                my $obj  = instance(shift, &#39;Foo&#39;);
                # ...
        }

        use Data::Util qw(:check);

        sub bar{
                my $x = shift;
                if(is_scalar_ref $x){
                        # $x is an array reference
                }
                # ...
                elsif(is_instance $x, &#39;Foo&#39;){
                        # $x is an instance of Foo
                }
                # ...
        }

        # miscelaneous
        use Data::Util qw(:all);

        my $x = anon_scalar();
        $x = anon_scalar($x); # OK

        my $stash = get_stash(&#39;Foo&#39;);

        install_subroutine(&#39;Foo&#39;,
                hello  =&gt; sub{ &quot;Hello!\n&quot; },
                goodby =&gt; sub{ &quot;Goodby!\n&quot; },
        );

        print Foo::hello(); # Hello!

        my($pkg, $name) = get_code_info(\&amp;Foo::hello); # =&gt; (&#39;Foo&#39;, &#39;hello&#39;)
        my $fqn         = get_code_info(\&amp;Foo::hello); # =&gt;  &#39;Foo::hello&#39;
        my $code        = get_code_ref(&#39;Foo&#39;, &#39;hello&#39;);  # =&gt; \&amp;Foo::hello

        uninstall_subroutine(&#39;Foo&#39;, qw(hello goodby));

    # simple format for errro messages (not the same as Data::Dumper)
        print neat(&quot;Hello!\n&quot;); # =&gt; &quot;Hello!\n&quot;
        print neat(3.14);       # =&gt; 3.14
        print neat(undef);      # =&gt; undef</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p>This module provides utility functions for data and data types, including functions for subroutines and symbol table hashes (stashes).</p>

<p>This module makes for a pure Perl and XS implementation.</p>

<p>However, if you want to use the full capacity of it, we recommend you to opt for the XS backend.</p>

<p>There are many benchmarks in the <i>DIST-DIR/benchmark/</i> directory.</p>

<h1 id="INTERFACE">INTERFACE</h1>

<h2 id="Check-functions"><a id="Check"></a>Check functions</h2>

<p>Check functions are introduced by the <code>:check</code> import tag, which check the argument type and return a bool.</p>

<p>These functions also check for overloading magic, e.g. <code>${}</code> corresponds to a SCALAR reference.</p>

<dl>

<dt id="is_scalar_ref(value)"><a id="is_scalar_ref"></a><a id="is_scalar_ref-value"></a>is_scalar_ref(value)</dt>
<dd>

<p>Checks for a SCALAR reference.</p>

</dd>
<dt id="is_array_ref(value)"><a id="is_array_ref"></a><a id="is_array_ref-value"></a>is_array_ref(value)</dt>
<dd>

<p>Checks for an ARRAY reference.</p>

</dd>
<dt id="is_hash_ref(value)"><a id="is_hash_ref"></a><a id="is_hash_ref-value"></a>is_hash_ref(value)</dt>
<dd>

<p>Checks for a HASH reference.</p>

</dd>
<dt id="is_code_ref(value)"><a id="is_code_ref"></a><a id="is_code_ref-value"></a>is_code_ref(value)</dt>
<dd>

<p>Checks for a CODE reference.</p>

</dd>
<dt id="is_glob_ref(value)"><a id="is_glob_ref"></a><a id="is_glob_ref-value"></a>is_glob_ref(value)</dt>
<dd>

<p>Checks for a GLOB reference.</p>

</dd>
<dt id="is_rx(value)"><a id="is_rx"></a><a id="is_rx-value"></a>is_rx(value)</dt>
<dd>

<p>Checks for a regular expression reference generated by the <code>qr//</code> operator.</p>

</dd>
<dt id="is_instance(value,-class)"><a id="is_instance"></a><a id="is_instance-value--class"></a>is_instance(value, class)</dt>
<dd>

<p>Checks for an instance of <i>class</i>.</p>

<p>It is equivalent to the following statement: <code>Scalar::Util::blessed($value) &amp;&amp; $value-&gt;isa($class)</code>.</p>

</dd>
<dt id="is_invocant(value)"><a id="is_invocant"></a><a id="is_invocant-value"></a>is_invocant(value)</dt>
<dd>

<p>Checks for an invocant, i.e. a blessed reference or existent package name.</p>

<p>If <i>value</i> is a valid class name but does not exist, it will return false.</p>

</dd>
<dt id="is_value(value)"><a id="is_value"></a><a id="is_value-value"></a>is_value(value)</dt>
<dd>

<p>Checks whether <i>value</i> is a primitive value, i.e. a defined, non-ref, and non-type-glob value.</p>

<p>This function has no counterpart for validation.</p>

</dd>
<dt id="is_string(value)"><a id="is_string"></a><a id="is_string-value"></a>is_string(value)</dt>
<dd>

<p>Checks whether <i>value</i> is a string with non-zero-length contents, equivalent to <code>is_value($value) &amp;&amp; length($value) &gt; 0</code>.</p>

<p>This function has no counterpart for validation.</p>

</dd>
<dt id="is_number(value)"><a id="is_number"></a><a id="is_number-value"></a>is_number(value)</dt>
<dd>

<p>Checks whether <i>value</i> is a number. Here, a <b>number</b> means that the perl parser can understand it and that the perl numeric converter (e.g. invoked by <code>sprintf &#39;%g&#39;, $value</code>) doesn&#39;t complain about it.</p>

<p>It is similar to <code>Scalar::Util::looks_like_number()</code> but refuses <code>infinity</code>, <code>not a number</code> and <code>&quot;0 but true&quot;</code>. Note that <code>9**9**9</code> makes <code>infinity</code> and <code>9**9**9 - 9**9**9</code> makes <code>not a number</code>.</p>

<p>This function has no counterpart for validation.</p>

</dd>
<dt id="is_integer(value)"><a id="is_integer"></a><a id="is_integer-value"></a>is_integer(value)</dt>
<dd>

<p>Checks whether <i>value</i> is an integer. An <b>integer</b> is also a <b>number</b>, so this function refuses <code>infinity</code> and <code>not a number</code>. See also <code>is_number()</code>.</p>

<p>This function has no counterpart for validation.</p>

</dd>
</dl>

<h2 id="Validating-functions"><a id="Validating"></a>Validating functions</h2>

<p>Validating functions are introduced by the <code>:validate</code> tag which checks for the argument and returns the first argument. These are like the <code>:check</code> functions but dies if the argument type is invalid.</p>

<p>These functions also checks overloading magic, e.g. <code>${}</code> for a SCALAR reference.</p>

<dl>

<dt id="scalar_ref(value)"><a id="scalar_ref"></a><a id="scalar_ref-value"></a>scalar_ref(value)</dt>
<dd>

<p>Validates a SCALAR reference.</p>

</dd>
<dt id="array_ref(value)"><a id="array_ref"></a><a id="array_ref-value"></a>array_ref(value)</dt>
<dd>

<p>Validates an ARRAY reference.</p>

</dd>
<dt id="hash_ref(value)"><a id="hash_ref"></a><a id="hash_ref-value"></a>hash_ref(value)</dt>
<dd>

<p>Validates a HASH reference.</p>

</dd>
<dt id="code_ref(value)"><a id="code_ref"></a><a id="code_ref-value"></a>code_ref(value)</dt>
<dd>

<p>Validates a CODE reference.</p>

</dd>
<dt id="glob_ref(value)"><a id="glob_ref"></a><a id="glob_ref-value"></a>glob_ref(value)</dt>
<dd>

<p>Validates a GLOB reference.</p>

</dd>
<dt id="rx(value)"><a id="rx"></a><a id="rx-value"></a>rx(value)</dt>
<dd>

<p>Validates a regular expression reference.</p>

</dd>
<dt id="instance(value,-class)"><a id="instance"></a><a id="instance-value--class"></a>instance(value, class)</dt>
<dd>

<p>Validates an instance of <i>class</i>.</p>

</dd>
<dt id="invocant(value)"><a id="invocant"></a><a id="invocant-value"></a>invocant(value)</dt>
<dd>

<p>Validates an invocant, i.e. a blessed reference or existent package name.</p>

<p>If <i>value</i> is a valid class name and the class exists, then it returns the canonical class name, which is logically cleaned up. That is, it runs <code>$value =~ s/^::(?:main::)*//;</code> before returning it.</p>

<p>NOTE: Canonization is done so due to an inconsistency between Perl versions. For instance:</p>

<pre><code>        package ::Foo; # OK
        my $x = bless {}, &#39;::Foo&#39;; # OK
        ref($x)-&gt;isa(&#39;Foo&#39;); # Fatal</code></pre>

<p>The last code snippet causes a fatal error: <code>Can&#39;t call method &quot;isa&quot; without package or object reference</code>. However, <code>invocant(ref $x)-&gt;isa(&#39;Foo&#39;)</code> is always OK.</p>

</dd>
</dl>

<h2 id="Miscellaneous-utilities"><a id="Miscellaneous"></a>Miscellaneous utilities</h2>

<p>There are some other utility functions you can import from this module.</p>

<dl>

<dt id="anon_scalar()"><a id="anon_scalar"></a>anon_scalar()</dt>
<dd>

<p>Generates an anonymous scalar reference to <code>undef</code>.</p>

</dd>
<dt id="anon_scalar(value)"><a id="anon_scalar1"></a><a id="anon_scalar-value"></a>anon_scalar(value)</dt>
<dd>

<p>Generates an anonymous scalar reference to the copy of <i>value</i>.</p>

<p>It is equivalent to <code>do{ my $tmp = $value; \$tmp; }</code>.</p>

</dd>
<dt id="neat(value)"><a id="neat"></a><a id="neat-value"></a>neat(value)</dt>
<dd>

<p>Returns a neat string that is suitable to display.</p>

<p>This is a smart version of <code>&lt;do{ defined($value) ? qq{&quot;$value&quot;} : &#39;undef&#39; }</code>&gt;.</p>

</dd>
<dt id="get_stash(invocant)"><a id="get_stash"></a><a id="get_stash-invocant"></a>get_stash(invocant)</dt>
<dd>

<p>Returns the symbol table hash (also known as <b>stash</b>) of <i>invocant</i> if the stash exists.</p>

</dd>
<dt id="install_subroutine(package,-name-=&gt;-subr-[,-...])"><a id="install_subroutine"></a><a id="install_subroutine-package--name---subr"></a>install_subroutine(package, name =&gt; subr [, ...])</dt>
<dd>

<p>Installs <i>subr</i> into <i>package</i> as <i>name</i>.</p>

<p>It is similar to <code>do{ no strict &#39;refs&#39;; *{$package.&#39;::&#39;.$name} = \&amp;subr; }</code>. In addition, if <i>subr</i> is an anonymous subroutine, it is located into <i>package</i> as a named subroutine <i>&amp;package::name</i>.</p>

<p>For example:</p>

<pre><code>        install_subroutine($pkg,   say =&gt; sub{ print @_, &quot;\n&quot; });
        install_subroutine($pkg,
                one =&gt; \&amp;_one,
                two =&gt; \&amp;_two,
        );

        # accepts a HASH reference
        install_subroutine($pkg, { say =&gt; sub{ print @_, &quot;\n&quot; }); #</code></pre>

<p>To re-install <i>subr</i>, use <code>no warnings &#39;redefine&#39;</code> directive:</p>

<pre><code>        no warnings &#39;redefine&#39;;
        install_subroutine($package, $name =&gt; $subr);</code></pre>

</dd>
<dt id="uninstall_subroutine(package,-names...)"><a id="uninstall_subroutine"></a><a id="uninstall_subroutine-package--names"></a>uninstall_subroutine(package, names...)</dt>
<dd>

<p>Uninstalls <i>names</i> from <i>package</i>.</p>

<p>It is similar to <code>Sub::Delete::delete_sub()</code>, but uninstall multiple subroutines at a time.</p>

<p>If you want to specify deleted subroutines, you can supply <code>name =&gt; \&amp;subr</code> pairs.</p>

<p>For example:</p>

<pre><code>        uninstall_subroutine(&#39;Foo&#39;, &#39;hello&#39;);

        uninstall_subroutine(&#39;Foo&#39;, hello =&gt; \&amp;Bar::hello);

        uninstall_subroutine($pkg,
                one =&gt; \&amp;_one,
                two =&gt; \&amp;_two,
        );

        # accepts a HASH reference
        uninstall_subroutine(\$pkg, { hello =&gt; \&amp;Bar::hello });</code></pre>

</dd>
<dt id="get_code_info(subr)"><a id="get_code_info"></a><a id="get_code_info-subr"></a>get_code_info(subr)</dt>
<dd>

<p>Returns a pair of elements, the package name and the subroutine name of <i>subr</i>.</p>

<p>It is similar to <code>Sub::Identify::get_code_info()</code>, but it returns the fully qualified name in scalar context.</p>

</dd>
<dt id="get_code_ref(package,-name,-flag?)"><a id="get_code_ref"></a><a id="get_code_ref-package--name--flag"></a>get_code_ref(package, name, flag?)</dt>
<dd>

<p>Returns <i>&amp;package::name</i> if it exists, not touching the symbol in the stash.</p>

<p>if <i>flag</i> is a string <code>-create</code>, it returns <i>&amp;package::name</i> regardless of its existence. That is, it is equivalent to <code>do{ no strict &#39;refs&#39;; \&amp;{package . &#39;::&#39; . $name} }</code>.</p>

<p>For example:</p>

<pre><code>        $code = get_code_ref($pkg, $name);          # like  *{$pkg.&#39;::&#39;.$name}{CODE}
        $code = get_code_ref($pkg, $name, -create); # like \&amp;{$pkg.&#39;::&#39;.$name}</code></pre>

</dd>
<dt id="curry(subr,-args-and/or-placeholders)"><a id="curry"></a><a id="curry-subr--args-and-or-placeholders"></a>curry(subr, args and/or placeholders)</dt>
<dd>

<p>Makes <i>subr</i> curried and returns the curried subroutine.</p>

<p>This is also considered as lightweight closures.</p>

<p>See also <a href="https://metacpan.org/pod/distribution/Data-Util/lib/Data/Util/Curry.pod">Data::Util::Curry</a>.</p>

</dd>
<dt id="modify_subroutine(subr,-...)"><a id="modify_subroutine"></a><a id="modify_subroutine-subr"></a>modify_subroutine(subr, ...)</dt>
<dd>

<p>Modifies <i>subr</i> with subroutine modifiers and returns the modified subroutine. This is also considered as lightweight closures.</p>

<p><i>subr</i> must be a code reference or callable object.</p>

<p>Optional arguments: <code>before =&gt; [subroutine(s)]</code> called before <i>subr</i>. <code>around =&gt; [subroutine(s)]</code> called around <i>subr</i>. <code>after =&gt; [subroutine(s)]</code> called after <i>subr</i>.</p>

<p>This seems a constructor of modified subroutines and <code>subroutine_modifier()</code> is property accessors, but it does not bless the modified subroutines.</p>

</dd>
<dt id="subroutine_modifier(subr)"><a id="subroutine_modifier"></a><a id="subroutine_modifier-subr"></a>subroutine_modifier(subr)</dt>
<dd>

<p>Returns whether <i>subr</i> is a modified subroutine.</p>

</dd>
<dt id="subroutine_modifier(modified_subr,-property)"><a id="subroutine_modifier1"></a><a id="subroutine_modifier-modified_subr--property"></a>subroutine_modifier(modified_subr, property)</dt>
<dd>

<p>Gets <i>property</i> from <i>modified</i>.</p>

<p>Valid properties are: <code>before</code>, <code>around</code>, <code>after</code>.</p>

</dd>
<dt id="subroutine_modifier(modified_subr,-modifier-=&gt;-[subroutine(s)])"><a id="subroutine_modifier2"></a><a id="subroutine_modifier-modified_subr--modifier----subroutine-s"></a>subroutine_modifier(modified_subr, modifier =&gt; [subroutine(s)])</dt>
<dd>

<p>Adds subroutine <i>modifier</i> to <i>modified_subr</i>.</p>

<p>Valid modifiers are: <code>before</code>, <code>around</code>, <code>after</code>.</p>

</dd>
<dt id="mkopt(input,-moniker,-require_unique,-must_be)"><a id="mkopt"></a><a id="mkopt-input--moniker--require_unique--must_be"></a>mkopt(input, moniker, require_unique, must_be)</dt>
<dd>

<p>Produces an array of an array reference from <i>input</i>.</p>

<p>It is compatible with <code>Data::OptList::mkopt()</code>. In addition to it, <i>must_be</i> can be a HASH reference with <code>name =&gt; type</code> pairs.</p>

<p>For example:</p>

<pre><code>        my $optlist = mkopt([&#39;foo&#39;, bar =&gt; [42]], $moniker, $uniq, { bar =&gt; &#39;ARRAY&#39; });
        # $optlist == [[foo =&gt; undef], [bar =&gt; [42]]</code></pre>

</dd>
<dt id="mkopt_hash(input,-moniker,-must_be)"><a id="mkopt_hash"></a><a id="mkopt_hash-input--moniker--must_be"></a>mkopt_hash(input, moniker, must_be)</dt>
<dd>

<p>Produces a hash reference from <i>input</i>.</p>

<p>It is compatible with <code>Data::OptList::mkopt_hash()</code>. In addition to it, <i>must_be</i> can be a HASH reference with <code>name =&gt; type</code> pairs.</p>

<p>For example:</p>

<pre><code>        my $optlist = mkopt([&#39;foo&#39;, bar =&gt; [42]], $moniker, { bar =&gt; &#39;ARRAY&#39; });
        # $optlist == {foo =&gt; undef, bar =&gt; [42]}</code></pre>

</dd>
</dl>

<h1 id="ENVIRONMENT-VARIABLES"><a id="ENVIRONMENT"></a>ENVIRONMENT VARIABLES</h1>

<h2 id="DATA_UTIL_PUREPERL">DATA_UTIL_PUREPERL</h2>

<p>If true, <code>Data::Util</code> uses the pure Perl implementation.</p>

<h1 id="DEPENDENCIES">DEPENDENCIES</h1>

<p>Perl 5.10 or later.</p>

<p>If you have a C compiler, you can use the XS backend.</p>

<p>A pure Perl backend/implementation is also made available in case you have no C compiler handy (unlikely!).</p>

<h1 id="BUGS-AND-LIMITATIONS"><a id="BUGS"></a>BUGS AND LIMITATIONS</h1>

<p>No bugs have been reported.</p>

<p>Please report any bugs or feature requests to the author.</p>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/Scalar::Util">Scalar::Util</a>.</p>

<p><a href="https://metacpan.org/pod/overload">overload</a>.</p>

<p><a href="https://metacpan.org/pod/Params::Util">Params::Util</a>.</p>

<p><a href="https://metacpan.org/pod/Sub::Install">Sub::Install</a>.</p>

<p><a href="./Sub::Identify.html">Sub::Identify</a>.</p>

<p><a href="https://metacpan.org/pod/Sub::Delete">Sub::Delete</a>.</p>

<p><a href="https://metacpan.org/pod/Sub::Curry">Sub::Curry</a>.</p>

<p><a href="https://metacpan.org/pod/Class::MOP">Class::MOP</a>.</p>

<p><a href="https://metacpan.org/pod/Class::Method::Modifiers">Class::Method::Modifiers</a>.</p>

<p><a href="https://metacpan.org/pod/Data::OptList">Data::OptList</a>.</p>

<p><a href="https://metacpan.org/pod/Mouse">Mouse</a></p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Goro Fuji(gfx) &lt;gfuji(at)cpan.org&gt;.</p>

<h1 id="LICENSE-AND-COPYRIGHT"><a id="LICENSE"></a>LICENSE AND COPYRIGHT</h1>

<p>Copyright (c) 2008-2010, Goro Fuji &lt;gfuji(at)cpan.org&gt;. All rights reserved.</p>

<p>This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install Data::Util, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm Data::Util</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install Data::Util</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./Data::Util.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
